Minor changes to make it compatible with HAWQ