Fix bugs in ContinuousVisible and add regression test