Fix jail state detection