Fixed some null pointer crashes...