Fixed assignment operator and added tests