Fixed a bug in the vector reversal