cleaning tests and some orm fixes