Fixed bug in getting positions for some of the cases