fixed another bug found by brian
Merge remote-tracking branch 'origin/master' into brian-branch-v5