Added initialization for immediate mode.