fix some inconsistency in generator