Fix parser error handling

Signed-off-by: Pekka Enberg <penberg@iki.fi>