Build fixes and cleanup