Issue 340

Fixed some typos

Put common SP creation code into algorithm_test_helpers.py

Responded to pull request feedback.