Fixed some bugs in selectButton when options array is passed.