Added checks for duplicate definitions and overwrites of reserved variables.