Clean up and fix pending problems