some necessary fixes