Some NPE fixes.

Signed-off-by: Jared Woolston <jwoolston@tenkiv.com>