fix max_forward code change
fix variable name
fix tab/space use for comment