Various small improvements/fixes