Corrected handling of schema wrt foreign keys
Use default schema name when appropriate

missed this on my last commit