Fixes some minor bugs