Backport 0.2.x fixes