Minor fixes (comments, better function names, etc.)