fix a few critical management bugs. refine template editor...