Some fixes and renaming.