Clean up code, fix all compiler warnings.