Fixed pointer issue and added missing constructor