Little cleanup & some null checks.