Fixed a bug in calling smoothts function.