Fixed switching error. Arrays need to be fixed
fixed array tests, controls template still causes infinite loop.