Compilation and other fixes / cleanup.