Fixed compile and testing errors
Fixed dialyzer errors