Fixed a bug in buffer_move_forward