safer get function

I was gettings errors when i try to get "foo.bar" when there is no foo.