Fixed bug when going in reverse for robust result