Pull request https://github.com/nhibernate/nhibernate-core/pull/151
Applied to master 80358ba7ee86150bdaa9e8d961b0ffbda773f1a9