support negative number for xtemplate. Fixes #322.