Tighten up filehandle changes & error reporting & documentation