     }
     
     var m_Int : Int32 {
-        get { return m_Pointer.memory.m_Int }
-        set( val ) { m_Pointer.memory.m_Int = val }
+        get { return m_Pointer.pointee.m_Int }
+        set( val ) { m_Pointer.pointee.m_Int = val }
     }
     var m_Long : Int64 {
-        get { return m_Pointer.memory.m_Long }
-        set( val ) { m_Pointer.memory.m_Long = val }
+        get { return m_Pointer.pointee.m_Long }
+        set( val ) { m_Pointer.pointee.m_Long = val }
     }
     var m_Array : (Int16, Int16, Int16)
     {
-        get { return (m_Pointer.memory.m_Array.0,
-                        m_Pointer.memory.m_Array.1,
-            m_Pointer.memory.m_Array.2) }
+        get { return (m_Pointer.pointee.m_Array.0,
+                        m_Pointer.pointee.m_Array.1,
+            m_Pointer.pointee.m_Array.2) }
         set ( val ) {
-            m_Pointer.memory.m_Array.0 = val.0
-            m_Pointer.memory.m_Array.1 = val.1
-            m_Pointer.memory.m_Array.2 = val.2
+            m_Pointer.pointee.m_Array.0 = val.0
+            m_Pointer.pointee.m_Array.1 = val.1
+            m_Pointer.pointee.m_Array.2 = val.2
         }
     }
 }
 
 /**
- * Dumps selected fields from an instance of WrapperStruct.
+ * Dumps an instance of WrapperStruct.
  */
-func printWrapper( s : WrapperStruct )
+func printWrapper( _ s : WrapperStruct )
 {
     print( "Printing APIStruct: " )
+    print( "  m_Int: \(s.m_Int)" )
     print( "  m_Long: \(s.m_Long)" )
     print( "  m_Array: \(s.m_Array.0) \(s.m_Array.1) \(s.m_Array.2) " )
 }
 
 /**
- * A callback implementation that casts the argument to 
+ * A callback implementation that converts the argument to
  * UnsafeMutablePointer<APIStrunct> and wraps that in a WrapperStruct. 
  * Please note that changes made via the WrapperStruct properties
  * are visible to the C code!
  *
  * Notice that here we use a top-level Swift function instead of a closure
- * literal.  Swift 2.1 documentation states that top-level functions can be
- * passed where a function pointer parameter is required.  We could have used
+ * literal. We could have used
  * a literal as well.
  */
-func TwoWayCallback( p : UnsafeMutablePointer<Void> )->Void
+func TwoWayCallback( _ p : UnsafeMutableRawPointer? )->Void
 {
     print( "In TwoWayCallback(), received a void pointer. " );
-    var _wS : WrapperStruct = WrapperStruct(_p: (UnsafeMutablePointer<APIStruct>(p)))
-    printWrapper( _wS )
-    print( "Setting m_Long in the structure to 98765432109 " )
-    _wS.m_Long = 98765432109
-    print( "Setting the array to 111, 222, 333" )
-    _wS.m_Array.0 = 111
-    _wS.m_Array.1 = 222
-    _wS.m_Array.2 = 333
+    if let ptr = p?.assumingMemoryBound(to: APIStruct.self) {
+        var _wS : WrapperStruct = WrapperStruct(_p: ptr)
+        printWrapper( _wS )
+        print( "Setting m_Long in the structure to 98765432109 " )
+        _wS.m_Long = 98765432109
+        print( "Setting the array to 111, 222, 333" )
+        _wS.m_Array.0 = 111
+        _wS.m_Array.1 = 222
+        _wS.m_Array.2 = 333
+    }
+    else { print("APIStruct pointer is nil.") }
 }
 
 print("")
 /**
  * Call C code with our more sophisticated 2-way callback.
  */
-CUseCallback( TwoWayCallback, 1 )
+CUseCallback( TwoWayCallback , 1 )

 * C code.  This is because we modify a copy of the structure 
 * populated by the C code.
 */
let OneWayCallback : my_cb_t = {( p : UnsafeMutablePointer<Void> )->Void in
    print( "In OneWayCallback(), received a void pointer. " );
    var _apiS : APIStruct = (UnsafeMutablePointer<APIStruct>(p)).memory
    printAPI ( _apiS );
    print( "Setting m_Long in the structure to 98765432109 " )
    _apiS.m_Long = 98765432109
}


/**
 * A better callback implementation.
 *
 * This one converts the void pointer to UnsafeMutablePointer<APIStruct>,
 * then uses its memory to construct an instance of APIStruct.  Even if
 * tight packing is used by the C code, the APIStruct will correctly 
 * reflect the data placed there by the C code.  This is as long as 
