Fixing a stalling problem when running tests