Bug fixes and enhancements. Added a little more stuff to sample.