Adding Grant's fixes