Fixes for normalize function