Fixed this problem but found you cannot set a primary key as a foreign key reference, which prevents you from using this plugin to create a m2m table with foreign key references. I'll fix that in a separate issue.
Originally posted by @simonw in #51 (comment)