fixed tex error handling
removed cleaning, added keep_tex, fixed temp dirs