Fixed error handling in Travis scripts