david's fixes