Cleanup some code. Add extra checks. Revert a recent change to autoloader that was a mistake.