Ali's fixes