Fix sqlite bug