Fix some known bugs