Bugfixes to inactivity and movement