Fix tests and prepare for travis ci