minor fixes in memory allocation code (float->double)