core: Fix normalizeWhitespace.