some fixes and extensions