Fixed NPE (hopefully)