Prevented a NullPointerException.
Prevented various NullPointerException.