Fix some misc bug