fixed bugs reported by Bob #28
Merge remote-tracking branch 'origin/master'