Fix doc examples. Closes #297