generate: Fix dimension bug