compilation fix for IJ13
(cherry picked from commit 1648598)
made compatible with both IJ12 and 13 (by Vojtěch Krása)
(cherry picked from commit 6d956269e77776ef5256d692364cb3dc78d99d9e)