Patched DatabaseRouter to fix #412