Minor changes to logging function