These 3 blocks appear to revert a previous commit - sub_type and sub_pts should have their scope restricted.