Some housekeeping patches