Fixed some bugs on heading