Various small fixes