Match function naming to style guide and add basic error checking.

Those function names were really bothering me.