Small changes to fread() and is_valid_address()