fixes some minor bugs