Updated print statements and null checks