Fixed normalization bug and added test