Some changes to p3/ code