fixes and cleanup of splice()