Corrects p_wrapper to support more return values