fixing the handling of extension object, relates to #141