Pass connection name to query event. Closes #1300.
Fix comment.
Fix type detection on dirty attribute routine. Closes #1182.