fix keyword parseing for xtemplate. Fixes #660