FIX - prevent negative array size