Improved error messages in TestIsPath