Fixed bugs and added dependencies