Added singularity management for the normal vector