Various small improvements + additional test