Fix issue #57: Replace [] with null where necessary
Merge pull request #58 from KhronosGroup/emptyArrayFix

Fix issue #57: Replace [] with null where necessary.