fix several bugs in and cleanup code from original implementation
Merge pull request #1 from warrenfalk/copy_resources_from_config

fix several bugs in and cleanup code from original implementation