Converted the #errors code to use nokogiri.