SP boost bugfix

WIP for issue #462. Not ready for merge yet. My local tests pass but I want to see if the Travis build passes.