Use dict.get where appropriate