pretty-print block
cleanup val handling in path replacement