Fixing pointer assignment