Added a couple of exceptions, wrote some spock tests