Fixed issue where artisan optimize would sometimes time out when generating classes