Fix unused imports, more restrictive compilation flags. Preparing for more cleanups.