Fixed possible future NPE's