Fix converting arrays on py3
Fix metaclasses on Python 3