Some fixes based on Hartmut's suggestions.