adding a default value for keys and fixed compile errors.