Added proper SP cleanup.