Fixed mistake in normalization function