Attempt fix for issue #221 - segfaults when smoothing