merged Klaus' changes and new test cases into slv branch