Cleanup includes and error checks in testread