Fix compiling error of deprecated template.

Fix compiling error of deprecated template issue #300.