Improved year/semester selection code, and fixed typo