Adding latest preloader code from pull request on issue #145