Fixed logging problem when pre or post run commands were set.