Improved _to_native method, added a few tests for data types.