Fix bugs for running hive