Minor changes to functions