Added alternative P_is_constant definition
Minor cleanup