minor updates
Fixed issue with bad argument. Added check to ensure the result contains the specified key.