fix two compatible issues between 4.x and 2.3.x