Fix crash when the stored coordinates are invalid