fixes for #1367
Merge pull request #1546 from conejoninja/1367b

1367b