Make opts key retrieval more robust/correct