A few  bug fixes.