Fix for #219

Closes https://github.com/j4mie/idiorm/issues/219