Fix bug in generic mode.