Added autoloading for main functions.