This fix error #1 and #2

Fix for the bug#1 and the bug#2