Fix normalization bug.

There is a bug in normalization that was introduced with 672aec002f5d2e5b53f78e0a2e836e1da8996ec6.

Fixes #747