Fixed 2 NPE's