Fix warnings in tests
Use slice operators