Various error fixes.