Properly handle different profiles (skipping SPS data as needed).
Correctly propagate errors