Added sanity check on memory initialization.