Don't make assumptions about the max number of attributes

Some hardware might support more that we want to use I suppose. -1 is a
better flag value to use since it's an invalid index instead of simply
bigger than the minimum required