Numerous fixes to totally broken tf_interface.h