minor bug fixes and an updated example