fix some invalid template tags
add mock library