Merge pull request #36 from rfjakob/master

Reverse mode improvements