Bug fixes, small enhancements