Various small fixes and adjustments