Fixed redefinition error, added a test