more IJ12 compatible code
(cherry picked from commit b2efe32)