Fixed database bug causing courses to not get managed correctly (fixes #20)