resolve errors in recent pulls

* Fixes #1040
* Fixes #1042
* Jenkins: http://jenkins.buttonweavers.com:8080/job/buttonmen-cgolubi1/297/