remove several bugs