Addressed code review comments.

- Also added extra context to errors where it made sense.

#2469