Fix stack trace in prereq, fix #6057