Updated to fix bug with column names containing spaces