Improved documentation and removed errors from examples