Track down troublesome bug. Other minor corrections.