Fixed bugs and added features