Some new fixes (can be untested)