Fix a bug in ram'