Check for key in dict before getting it.

All of the spec_*_test work for me now.