Bug/116 expect and with

This has been cleaned up in a separate branch.