small bugs and allow transform

Following your request: a simplified pull request
patches to apply are a1b6347 3d20804 d88c12 d739dc0 85a9d1e