Added multiple enhancements, see GitHub issues for details