cleanup pbf code + another windows compile fix