Modified constructor.