Fix some bugs after last mergin