fix various functions to return special values for invalid parts
fix various functions to return special values for invalid parts

ccdevnet/openc2e,bdonlan/openc2e,ccdevnet/openc2e,crystalline/openc2e,crystalline/openc2e,bdonlan/openc2e,crystalline/openc2e,bdonlan/openc2e,crystalline/openc2e,ccdevnet/openc2e,ccdevnet/openc2e,bdonlan/openc2e,ccdevnet/openc2e,ccdevnet/openc2e,crystalline/openc2e