Split parsing/applying. Better error logging. Fix crash.