Fix invalid index in column lookup
Merge pull request #307 from iarna/complete/fix-foreign-key-index-error

Fix invalid index in column lookup