Added test to ensure documentation examples are syntax-correct.
Fixed syntax errors in documentation examples.