Added trigger timeout; fixed output issue with printf