Fixing a bug that Hassan introduced that is nearly impossible to recreate except for automated tests
Merge pull request #840 from jdalphon/master

Fix failing tests
Merge remote-tracking branch 'upstream/master' into jp747