Handle finishAfterIntent correctly.