Fix bug #29 and Bug #33
Fix bug #29 and Bug #33