Fixed hive issues to make it stable