Refactored example code.
Fixed some property accessors giving an error.