add test for 'name' attribute and fix behavior