Code clean up and adjusted build scripts.