Added refstr type.
Some minor cleaning.