Improve mix new error messages
Avoid race conditions in the struct detection