Merge "Revert "Fix NPE for invalid target exception""