Added some specs and fixed some dialyzer warnings