Fixed some bugs caused by wx 2.8