Adds null reference checks for `GetValue<T>`.

Fixes #134