You can check the fuel pump by measuring the fuel pressure at the front of the injector rail. It should be about 50 psi +- 3 psi.
The SAP vacuum hose could/would cause the P0171/p0174 codes, did you check the hose under the valve cover and around the back of the cylinder head?
Even brand new BMW parts can fail. Make sure the connection and wiring are still good.
Discounts on new and CPO cars.
Most Dealers offer a parts discount, BMP Design 10% off