Addressed comments.
Added Anton's fixes from other branch.