minor tweaks to sqlite connection handling