fix a nhibernate bug.