Fixed various bugs arising from removing Position class