Added fixes mentioned in bugreport 3306
- Added author provided fixes
- Added code example
- Added documentation fixes