Minor changes to a few functions