Fixed a bug where adding an object as a constructor rule argument would
cause some unexpected behaviour. Added some other small fixes and added
some docblocks, too.