Fixed bugs and added new features