Print errors to stderr. Refactor doc strings.