Fixes #601 - checking also if foreign key name is empty.

Fix for #601.