change array size method from "count" (breaks on my Windows) to "length"
restrict overly long error messages