Small bug fixes.

Signed-off-by: Egor Dudyak <gggorec@gmail.com>