Fixed rotation and reset

May fix issue #30