isForward support for binding direction

This pull request is base on this one: #147

The main difference is on line 522 where the isForward argument has
been add.

I assume this was the missing part of the previous pull request.