Fixed warnings and added more tests