Small code changes

Here are some small code changes.

Some more edits to the code as a follow on