Minor tweaking of code