Fixed small bugs, added more meaningful logs