Should raise less spurious warnings; added more comments.