Fixed bug in coursequery