synchronise with 0.9.6 stable branch