Replace tabs with whitespace and catch phantomjs errors