various extensions and bug fixes