Rebase #205 + add two small fixes