Clean up minor bugs