Fix edge-case with state initialization