Fix crashes on Travis