Somme errors in memory-handling fixed