Fix max_length not set