Add an extra preprocessing phase before validation.

Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>