Add error check after fixing file and remove unnecessary nil struct check (return val can never be nil)