Added paranoia null checks in Populate and cleaned up code.