Fixed bug with constructor