Code cleanup, Fix startup