Reset error after failures
Fix error logging for phantomjs script