Warning fixes and code refactoring (renamings).