Wrapped main in try-catch to clean code up a bit and remove undefine behavior. Added some checks to the Cohort constructor. Removed isinstance from py script, bad practice. Used try-except.