Cleanup and fix position rounding (fixes #202)