Fix infinite recursion in sem_locally_static. Issue #52