[Fixes #22] Setting undeclared attributes doesn't work and added tests