fixed minor bugs
merged minor fixes