Moved changes from #33 and #34 into the 2.0 development branch.