Fix a bug in RAM HDL generation.