bugfixes in stat mode, zero direction safe ray/box tests