More fixes and enhancements

Please review each commit