Some initial bug fixes.