several bugs repaired