Fixes for issues found by Portugao
Merge pull request #6 from robbrandt/Portugao

Fixes for issues found by Portugao