fixes from ticket #40