Some funcs should return null on error.

They were expected to return the empty string previously. The spec
requires returning null, though.
Merge pull request #803 from jdashg/null-on-error

Some funcs should return null on error.