Attempt to fix heap overflow