Change to accept attributes.
Change test to be more robust.