Fixed noise loop issue

See issue #18. @pimnijdam Could you take a quick look at this?