Some renaming and bug fixes.