Fix NPE's due to null IR