Fix string variable comparison
Cleanup and fixes for build dir handling