Fix: SQL reading from wrong table