fixes safe mode check, adds loophole dependency, adds safe mode spec