Fix assertions on shutdown, remove redundant calls.