This should probably be return x; instead of just x (currently it falls through and accidentally DTRT).
return x;
x