Use the _t consistency naming scheme. Also various cleanups.