FELIX-3345 Apply patch FELIX-3345-2.diff by David Jencks (thanks alot) slightly reformatted and turned around checks (assuming the positive success of failure)