Some bug fixes and speed improvements in getCoords