Cleanup and fix quality flaws