Bugfixes and enhancements

Enhancements

Bugfixes