Cleanup some problematic code