fixes to epub and TCP conversion