Fix a few NPE's