Fixed throwing exceptions when null.