prevent crash due to zero length string array
misc changes