Always check for nulls and add tests