Fix normalization bug.

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

Fixes #747
Merge pull request #748 from lossyrob/bug/normalization

Fix normalization bug.