* fix several bugs