Slightly improved testing and added test-cases