fix tests bugs