Various fixes to first use check and null checking