fixes for tickets 22, 20, 107, 102, in preparation for merging 26