Added safe dictionary access.