Fixed memory bug in lirc mode