Added back fixes that were removed in merge