Add LOCALS_MAX and more comments.