Fixed minor errors found by the code inspection