fix bug where read error was treated as success reading library headers