Bug fixes to read_data.c