Fixed small bug with default values in diagrams backend.

Also did some minor formatting and comment.