Merge "Fix NPEs when using the APIs a little oddly." into jb-dev