Added code to prevent NullPointerExceptions

Fixed computeRectangularity to use denormalize method