fixes for BIT-185 and BIT-199

Signed-off-by: Vladimir Vidinliev <v.vidinliev@gmail.com>