QueueModel: Fix bug causing foreign id to be null.