MDL-21782 fixed wrong removal of hidden courses - thanks Jay Knight for the report!