bug fix + partial fix for #34