NH-3735 and unit tests

https://nhibernate.jira.com/browse/NH-3735