Remove debugging code
Fix parsing of priority dependency frames

We don't want to overwrite the buffer (mostly for test purposes), so we
have to copy stuff we'll modify into a new buffer before modifying.