Improved error message for certain lambda expressions