Develop Version of #448

This is the develop version of #448

(The way this is different than your previous pull request is that I'm pulling bugfix_master into both master and develop.  This uses the same commit to implement the bugfix, which won't cause conflicts later on)