Simplified reftypes. Added units. Fixed errors.