Code clean up and fix some build.prop related issues