Bugfix splrep

This fixes #2883 and a related undocumented bug.