fix bugs on tf.