Fixed bugs in setup