Bug fixes

Minor enhancements here and there