fixed orm_structure + added tests