Bug fix in rock physics model and some memory leakages