You should be using name() on $column. Some joker somewhere will be using spaces or other reserved characters in their column names.