Fixes some minor bugs.