Added type prefixes, fixed nil-result bugs.

I have *no* idea why the prefix is MS. Feel free to `sed` them away.