Various build improvements