Add some logging and extra checks to new sqlite store helper functions