Make the labels option work properly for non foreign key columns

The labels option only worked for foreign keys. This patch allows them to be used for any column.