Fixed issue #1108 and #1112
Merge pull request #1110 from diguito69/master

Fixed issue #1108 and #1112