Same with $type. All fixed.