Fix sporadic travis ci failures