SpeedSort Bug Fixes

Fixed a number of maximum recursive depth exceeded errors and general
improved functionality.