small fixes

fixed than wrong identation plus one bug I made found by cppcheck.