fixed set of minor bugs