Major bugfixes and better code to courses/index/