Added parameter guards.

Also, added some more accessor macros.
Added some tests of guards.
Self-review