Fixed bug which caused empty array to cast to empty object - This is unsafe since Array inherits from Object - As a side effect an empty Object will cast to an Array but this is safer.