Modified operator = and fixed exception issue in operator [].