Fix cosmology docstring

This PR fixes #3161, a few typos and removes unused import and variables.