Various small fixes and features