Minor change to zoom functionality.
Added critical checks to insertLocation and insertPath.