Fixed multiple issues in course_take_course_access() that were fixed in course_enroll_access(). Eventually these will be merged.