Fixed bug assigning coordinates