     
     public var double: Double? {
         get {
-            if self.type == .Number {
-                return self.object.doubleValue
-            }
-            return nil
-        }
-        set {
-            self.object = newValue ?? NSNull()
+            return self.number?.doubleValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(double: newValue!)
+            } else {
+                self.object = NSNull()
+            }
         }
     }
     
     public var doubleValue: Double {
         get {
-            return self.double ?? 0.0
+            return self.numberValue.doubleValue
+        }
+        set {
+            self.object = NSNumber(double: newValue)
         }
     }
     
     public var float: Float? {
         get {
-            if self.type == .Number {
-                return self.object.floatValue
-            }
-            return nil
-        }
-        set {
-            self.object = newValue ?? NSNull()
+            return self.number?.floatValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(float: newValue!)
+            } else {
+                self.object = NSNull()
+            }
         }
     }
     
     public var floatValue: Float {
         get {
-            return self.float ?? 0.0
+            return self.numberValue.floatValue
+        }
+        set {
+            self.object = NSNumber(float: newValue)
         }
     }
     
     public var int: Int? {
         get {
-            if self.type == .Number {
-                return self.object.longValue
-            }
-            return nil
-        }
-        set {
-            self.object = newValue ?? NSNull()
+            return self.number?.longValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(integer: newValue!)
+            } else {
+                self.object = NSNull()
+            }
         }
     }
     
     public var intValue: Int {
         get {
-            return self.int ?? 0
+            return self.numberValue.integerValue
+        }
+        set {
+            self.object = NSNumber(integer: newValue)
         }
     }
     
     public var uInt: UInt? {
         get {
-            if self.type == .Number {
-                return self.object.unsignedLongValue
-            }
-            return nil
-        }
-        set {
-            self.object = newValue ?? NSNull()
+            return self.number?.unsignedLongValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(unsignedLong: newValue!)
+            } else {
+                self.object = NSNull()
+            }
         }
     }
     
     public var uIntValue: UInt {
         get {
-            return self.uInt ?? 0
+            return self.numberValue.unsignedLongValue
+        }
+        set {
+            self.object = NSNumber(unsignedLong: newValue)
         }
     }
 
     public var int8: Int8? {
         get {
-            if self.type == .Number {
-                return self.object.charValue
-            }
-            return nil
+            return self.number?.charValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(char: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var int8Value: Int8 {
         get {
-            return self.int8 ?? 0
+            return self.numberValue.charValue
+        }
+        set {
+            self.object = NSNumber(char: newValue)
         }
     }
     
     public var uInt8: UInt8? {
         get {
-            if self.type == .Number {
-                return self.object.unsignedCharValue
-            }
-            return nil
+            return self.number?.unsignedCharValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(unsignedChar: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var uInt8Value: UInt8 {
         get {
-            return self.uInt8 ?? 0
+            return self.numberValue.unsignedCharValue
+        }
+        set {
+            self.object = NSNumber(unsignedChar: newValue)
         }
     }
     
     public var int16: Int16? {
         get {
-            if self.type == .Number {
-                return self.object.shortValue
-            }
-            return nil
+            return self.number?.shortValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(short: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var int16Value: Int16 {
         get {
-            return self.int16 ?? 0
+            return self.numberValue.shortValue
+        }
+        set {
+            self.object = NSNumber(short: newValue)
         }
     }
     
     public var uInt16: UInt16? {
         get {
-            if self.type == .Number {
-                return self.object.unsignedShortValue
-            }
-            return nil
+            return self.number?.unsignedShortValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(unsignedShort: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var uInt16Value: UInt16 {
         get {
-            return self.uInt16 ?? 0
+            return self.numberValue.unsignedShortValue
+        }
+        set {
+            self.object = NSNumber(unsignedShort: newValue)
         }
     }
 
     public var int32: Int32? {
         get {
-            if self.type == .Number {
-                return self.object.intValue
-            }
-            return nil
+            return self.number?.intValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(int: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var int32Value: Int32 {
         get {
-            return self.int32 ?? 0
+            return self.numberValue.intValue
+        }
+        set {
+            self.object = NSNumber(int: newValue)
         }
     }
     
     public var uInt32: UInt32? {
         get {
-            if self.type == .Number {
-                return self.object.unsignedIntValue
-            }
-            return nil
+            return self.number?.unsignedIntValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(unsignedInt: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var uInt32Value: UInt32 {
         get {
-            return self.uInt32 ?? 0
+            return self.numberValue.unsignedIntValue
+        }
+        set {
+            self.object = NSNumber(unsignedInt: newValue)
         }
     }
     
     public var int64: Int64? {
         get {
-            if self.type == .Number {
-                return self.object.longLongValue
-            }
-            return nil
+            return self.number?.longLongValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(longLong: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var int64Value: Int64 {
         get {
-            return self.int64 ?? 0
+            return self.numberValue.longLongValue
+        }
+        set {
+            self.object = NSNumber(longLong: newValue)
         }
     }
     
     public var uInt64: UInt64? {
         get {
-            if self.type == .Number {
-                return self.object.unsignedLongLongValue
-            }
-            return nil
+            return self.number?.unsignedLongLongValue
+        }
+        set {
+            if newValue != nil {
+                self.object = NSNumber(unsignedLongLong: newValue!)
+            } else {
+                self.object =  NSNull()
+            }
         }
     }
     
     public var uInt64Value: UInt64 {
         get {
-            return self.uInt64 ?? 0
+            return self.numberValue.unsignedLongLongValue
+        }
+        set {
+            self.object = NSNumber(unsignedLongLong: newValue)
         }
     }
 }

            }
        }
        set {
            self.object = newValue ?? NSNull()
        }
    }
    

                return false
            }
        }
        set {
            self.object = NSNumber(bool: newValue)
        }
    }
}

