Automatic cursor allocation fixed