fixes for ticket #22