diff --git a/src/attributes.js b/src/attributes.js
index ce7b350..c9c3517 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -148,7 +148,7 @@ jQuery.fn.extend({
 	hasClass: function( selector ) {
 		var className = " " + selector + " ";
 		for ( var i = 0, l = this.length; i < l; i++ ) {
-			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+			if ( this[i].className && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
 				return true;
 			}
 		}
@@ -350,7 +350,7 @@ jQuery.extend({
 				return ret;
 
 			} else {
-				elem.setAttribute( name, "" + value );
+				elem.setAttribute( name, "" + String(value) );
 				return value;
 			}
 
diff --git a/src/core.js b/src/core.js
index ab0d9f7..989abbe 100644
--- a/src/core.js
+++ b/src/core.js
@@ -238,7 +238,7 @@ jQuery.fn = jQuery.prototype = {
 		if ( name === "find" ) {
 			ret.selector = this.selector + (this.selector ? " " : "") + selector;
 		} else if ( name ) {
-			ret.selector = this.selector + "." + name + "(" + selector + ")";
+			ret.selector = this.selector + "." + name + "(" + String(selector) + ")";
 		}
 
 		// Return the newly-formed element set
diff --git a/src/css.js b/src/css.js
index c60bcdd..eb31e46 100644
--- a/src/css.js
+++ b/src/css.js
@@ -317,9 +317,9 @@ function getWH( elem, name, extra ) {
 
 	if ( extra !== "margin" && extra !== "border" ) {
 		jQuery.each( which, function() {
-			val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+			val -= parseFloat( jQuery.css( elem, "border" + String(this) + "Width" ) ) || 0;
 			if ( !extra ) {
-				val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+				val -= parseFloat( jQuery.css( elem, "padding" + String(this) ) ) || 0;
 			}
 		});
 	}
@@ -327,7 +327,7 @@ function getWH( elem, name, extra ) {
 	if ( val > 0 ) {
 		if ( extra === "margin" ) {
 			jQuery.each( which, function() {
-				val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+				val += parseFloat( jQuery.css( elem, extra + String(this) ) ) || 0;
 			});
 		}
 		return val + "px";
@@ -335,7 +335,7 @@ function getWH( elem, name, extra ) {
 
 	// Fall back to computed then uncomputed css if necessary
 	val = curCSS( elem, name, name );
-	if ( val < 0 || val == null ) {
+	if ( Number(val) < 0 || val == null ) {
 		val = elem.style[ name ] || 0;
 	}
 	// Normalize "", auto, and prepare for extra
@@ -344,12 +344,12 @@ function getWH( elem, name, extra ) {
 	// Add padding, border, margin
 	if ( extra ) {
 		jQuery.each( which, function() {
-			val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
+			val += parseFloat( jQuery.css( elem, "padding" + String(this) ) ) || 0;
 			if ( extra !== "padding" ) {
-				val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
+				val += parseFloat( jQuery.css( elem, "border" + String(this) + "Width" ) ) || 0;
 			}
 			if ( extra === "margin" ) {
-				val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
+				val += parseFloat( jQuery.css( elem, extra + String(this) ) ) || 0;
 			}
 		});
 	}
