Signed-off-by: bdzzz <gavadinov@gmail.com>

Some minor bug fixes