Fix #50.
Fix #52.
Merge pull request #1 from taschetto/fix-51

Fix 51