Fixed reverse function.