Fixes based on @zsxwing's suggestions.