mantis 3704 and minor cleaning-up