fix slicing and add some tests to test_commands.py