Update Travis configuration and fix code according to CI