Added some error handling and initialization

Point center is initialized to (0,0) before adding all the corners.
Added error handling for sorting the corner points.