Strip trailing sp.
Reinstate code from master.