General cleanups fixes