Fixed some bugs

- Fixed bug that prevented polyline from updating when removing the
second of 2 waypoints.
- Fixed a bug that caused a crash when deleting the last waypoint.