Improved Integer detection.
Added foreign key creation.