Added tests for monad inferrence.