Debugged PBS integration (I hope...)