Removed old code, added missing exceptions

Using boolean return values would be better, but I don't want to break the API.