Some null handling and small fixes