target: Clean up returning errors in PR handling code