File path exception? + Error Checking

Clearly I have no idea what I'm doing, so I put the changes as comments.