Fix NPEs

They need to be fixed for the following WOT-fix to work:
https://bugs.freenetproject.org/view.php?id=5362