Fix various bugs in code
Merge branch 'master' of https://github.com/dmrd/oz