Removed IR code, fixed weird mode 0 bug.

Mode 0 bug will be refactored in next commit if refactoring does not
present any bugs.