Bug fix: Incorrect query when reloading after insert()