[+BUGFIX] Bugfixes in ORM framework