Fix #168, Fix #1506
fixing errors
pulling latests version and fixing small error
Merge pull request #1513 from antgonza/fix_168_1506

Fix #168, Fix #1506