Should solve #35 and similar issues.