bug 802625 - fixes and ideas from Clarissa