Recent bug-fixes and improvements.

1. For large courses, show one activity type at a time.

2. General code tidy-up.