fixing output/error code changes in headpin/sam 1.3