Fix if statement check in path.h, check for null first.

Also misc tiny cleanup in ROMReader.h and common.cpp.