Avoid panicking when adding to queue fails (fixes #41)