Attempt to fix DB errors

Brickimedia/brickimedia#133