hasOwnProperty check. Move whitespace replacement to after the columns loop.