Fixed nil-reference panic.