             
             return cleanedType == cleanedRecordedArgType
         case .InstanceOfWith(let input):
-            let isRecordedArgAnOptional = "\(recordedArg.dynamicType)".indexForMatching(regex: "^Optional<") != nil
+            let isRecordedArgAnOptional = isOptional(recordedArg)
             let passesOptionCheck = (input.option == ArgumentOption.Anything) ||
                                     (input.option == ArgumentOption.NonOptional && !isRecordedArgAnOptional) ||
                                     (input.option == ArgumentOption.Optional && isRecordedArgAnOptional)

}

private func isNil(value: Any) -> Bool {
    // Currently best known way to check for nil (Swift doesn't allow -> 'Any' == 'nil')
    let isValueAnOptional = "\(value.dynamicType)".rangeOfString("^Optional<", options: .RegularExpressionSearch, range: nil, locale: nil) != nil
    
    return isValueAnOptional && "\(value)" == "nil"
}

private func descriptionOfCalls(functionList functionList: Array<String>, argumentsList: Array<Array<Any>>) -> String {

            if let recordedArgAsObject = recordedArg as? AnyObject {
                return recordedArgAsObject.isKindOfClass(type)
            }

            assertionFailure(".KindOf only works on arguments that are a subclass of AnyObject")
            return false
        }
    } else {
