Minor bug fix and updates to samples for documentation.