Testsuite for Customdata and error #1140

Testsuite for Customdata and bug fix for #1140