Small bug in button set and an undefined index-type bug.