Fix merge bugs
Fix merge bugs (2)
Fix merge bugs (3)
Updated gen-build.php
Merge pull request #850 from sjinks/bug-fixes

Fix bugs introduced by merge conflicts