Add bail-out for w.p being undefined for #9