If ProcessWire is installed in a userdir folder, the module returns a 404.
For example:
http://localhost/~mark/processwiretest/
The problem seems to be caused by the following line (line 42):
$startpage = str_ireplace(trim(wire('config')->urls->root, '/'), '', $this->sanitizer->path(dirname($_SERVER['REQUEST_URI'])));
Since wire('config')->urls->root returns a URL, it seems more appropriate to use $this->sanitizer->url() instead of $this->sanitizer->path().
Replacing line 42 with the following seems to solve the problem:
$startpage = str_ireplace(trim(wire('config')->urls->root, '/'), '', $this->sanitizer->url(dirname($_SERVER['REQUEST_URI'])));