Merge pull request #7 from pmorie/dev/upgrade_analysis

Dev/upgrade analysis
Upgrade fixes
Upgrade fixes
Upgrade fixes
Upgrade fixes
Fix for env.rb hooks