Fix a problem of returning NoneType on recusively calling
Fix decode_qp