Fixes and clarity in trapezoid check function