Added error checking to the coordinate wrapper.