Code tweaks in response to comments 1