Added option for test mode; fixed cb bug