Cleanup and fix compilation.