Changed mock buildning to make it work with custom autoloader.
Merge branch 'bug_fixes' into develop