FIX error message from trees for large inputs

Fixes #2809 (hopefully).