Improved form validation checks to handle multiple courses in a more robust way