Fix deploy bugs