I'm not too sure about exactly where your oxygen sensor is, but in most cases it is installed very near, if not on, the exhaust manifold where it will be heated to high temperatures by the exhaust gasses. It looks a little bit like a spark plug with a wire coming off the top. It pretty much is removed and installed like one too. Oxygen sensors are generally not that expensive (around $50). First, I would make sure that the electrical connection to the oxygen sensor is sound.
The mass airflow sensor is installed between the air filter and the intake manifold. Again, I'm not sure exactly where yours is but, by definition, it measures the total amount of air entering the engine.
Did the dealer mention specific failure codes for each component?