Added an extra check for surface normal direction

This will avoid issues with close surfaces with different types (eg. a
roof next to a wall)