Some fixes against PR #4