Added some specs, bug fixes.