Issue 885

Fixes #885. 

Somehow got previous commits in here. Not sure how I did that, but will try to clean up.