Fix nil.to_i logic
Add test for setting $PORT
Use MB.app_root
Merge pull request #712 from RiotGames/nil_to_i

Fix nil.to_i logic