Fixed scalar type issue.
Forgot to rebase.