Fix some memory leaks in 3.1.0 admin