Add null check. Fix #101.