Some cleanups, thanks to NathanW