fixed multiple minor bugs