sorted some minor bugs