Make sure the directory still exists.
Fix some indentation errors.
Remove unneeded whitespace.
Merge branch 'upstream_code_cleanup'