Refactored if/else block into two ifs. Changed IOException() call to also report on which path the stat call failed.