Update with docstrings and minor improvements from pylint.