fix type
make it safer for an array underrun
use nice way to achieve the property name length