Various fixes, mainly to appease travis-ci