Prevent cascading type errors
Code formatting
Organize all getAgreeType functions into one section
Clean up constant check
Fix exception in constant cyclic checking