Compilation fixes and improvements.