fixed a bug in a local block allocation function.