Fixed SQLite bug where joined tables would break