Fixed issue causing position to be calculated incorrectly.