Additional fixes for Ticket #917, primarly bug fixes