Warning fixes, fixed problem with delete method and added some unit tests