Various minor bugs fixed.