ISIS-520: fixing regression (infinite loop if run under Tomcat).