Bug ad Error Fixes

Fixed issues with file reading from previous commit.