Ranges modified for some fields and several variables renamed.