Fixes #76: IDEA hangs and eats all memory