CLeanup and fix patches