Full fix for #195 (border flash bug)