Fixing some minor bugs.