sync with upstream; bugfixed; preaparing for new features