(a) In the case of every felony, every principal in the second degree and every accessory before the fact shall be punishable as if he or she were the principal in the first degree; and every accessory after the fact shall be confined in jail not more than one year and fined not exceeding $500. But no person in the relation of husband and wife, parent or grandparent, child or grandchild, brother or sister, by consanguinity or affinity, or servant to the offender, who, after the commission of a felony, shall aid or assist a principal felon, or accessory before the fact, to avoid or escape from prosecution or punishment shall be deemed an accessory after the fact.
(b) Notwithstanding the provisions of subsection (a) of this section, any person who knowingly harbors, conceals, maintains or assists the principal felon after the commission of the underlying offense violating the felony provisions of sections one, four, or nine of article two of this chapter, or gives such offender aid knowing that he or she has committed such felony, with the intent that the offender avoid or escape detention, arrest, trial or punishment, shall be considered an accessory after the fact and, upon conviction, be guilty of a felony and, confined in a state correctional facility for a period not to exceed five years, or a period of not more than one half of the maximum penalty for the underlying felony offense, whichever is the lesser maximum term of confinement. But no person who is a person in the relation of husband and wife, parent, grandparent, child, grandchild, brother or sister, whether by consanguinity or affinity, or servant to the offender shall be considered an accessory after the fact.