Cleaned up null check code for default values