Added tests, see <https://code.google.com/p/ontopia/issues/detail?id=28>