Normalize and fix bugs