More tests, some bug fixes; hopefully travis will work now too.