Fixed some bugs

latest commit 58f0881080
Dragos Dena authored