Fix formatting and sub state subscription issues