Some meta work + NPE fixes

First commit of this pull is just a bit of meta work... nothing interesting.
Second commit = minor thing to get rid of stack traces, still not special.
Third commit is actually a useful bugfix!