Some necessary fixes