Solves some minor bugs.