Bug fixes; small enhancements