Fixed bug in gradient perpindicularity adjustment.