Minor changes and bug fixing regarding auto decide function