fix crash when using instances of Comment/PI subtypes