Fix some issues and improve some features