Bug fixing, making tests