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