bug fixes (#236, #214)

Signed-off-by: Marcin Wiatr <mail.wichura@gmail.com>