Housekeeping and small fixes