Finish #262.

This branch does the merge needed to finish #262. I took that branch, merged master into it and fixed the one conflict. If this is merged then #262 can be closed.