Handle the case where the number of splits are different than the number of fields/types

Line 402 throws an ArrayIndexOutOfBoundsException in this case. Also added a defensive check in getSafeMessage().