Fix some errors cases #7