fix some small bugs in template app