Cloned instances reference the same objects

Fixed reference issues with cloning a knex instance.