fixed unoptimized writes for "var" declarations