Added state type check, fixed market state table formatting