Add auto_normalize function.