Fixed some issues raised in the comments.