Fix some npe introduced accidentally