some of dirk's fixes