Fixed some issues and added some features