Fix bugs in doc string functionality.