Build cleanup and fixes