Fixes source database sometimes being picked when it wasn't supposed to be.