A few small bug and cosmetic fixes