Fixed compatibility bugs