Build fixes and further cleanup