Fix the complie error

caused by inconsistent template parameters.
Merge pull request #1052 from Tonsty/master

Fix the complie error