Fixed tiny bug in position and added unit test for it