Fix bugs #4 #3