 	switch thing {
 	case let aString as String:
 		return aString
+	case let aNum as Float:
+		return String(aNum)
+	case let aNum as Double:
+		return String(aNum)
+	case let aNum as Int:
+		return String(aNum)
+	case let aNum as UInt:
+		return String(aNum)
+	case let aNum as Bool:
+		return String(aNum)
 	default:
-		return "\(thing)"
+		// Print a warning, but don't throw an exception. This is a runtime error that can and should be glossed over. But do add an HTML comment to aid in debugging.
+		print("WARNING: Tried to templatize a non-String or non-Number value:\(thing)")
+		return "<!--[skipped unknown type]-->"
 	}
 }
 
+//
 private func escapeHTML(html: String) -> String {
 	return html.stringByReplacingOccurrencesOfString("___•••amp•••___", withString:"")
 		.stringByReplacingOccurrencesOfString("&",  withString:"___•••amp•••___")

			default:
				return "Unknown component type."
			}
		}.reduce("", combine:+) // concatenate the components
	}
}


		.stringByReplacingOccurrencesOfString("___•••amp•••___", withString:"&amp;")
}

public class PutStuffHere : TemplateEngine {
	// Singleton pattern:
	public static let sharedInstance = PutStuffHere()
	private init(){}
	
	// Support for 3rd party parenthetical handling:
	var parentheticalDelegate : ParentheticalDelegate? = nil
	
	// Set to false if you want to include the entire HTML template; otherwise, PSH extracts whatever is in the body, so multiple templates/views can be concatenated before getting wrapped in a master <html>.
	var shouldExtractBody = true
	
	// The main regex. This can and should be extended with other syntaxes.
	private let regex = try! NSRegularExpression(pattern: "([\\s\\W]|^)(?:(?:put|insert)\\s+(.+?\\S)(?:\\s*\\(([^)]+)\\))?\\s+here)([\\W\\s]|$)", options: [.CaseInsensitive])
	
	// Internal cache
	private var templates : [String : SimpleTemplate] = [:]
	
	// protocol getter
	public var fileExtension : String { return "html" }
