Fixed optional dimension bug