Fixed error and added a negative test  #10