Fixed some bugs and added some user-friendly features