improvements for https://issues.jboss.org/browse/RAILO-2414
Merge remote-tracking branch 'origin/4.1' into 4.1
a non boolean 3th parameter should not be ignored, it should throw a cast exception