Bug fixing, updated