Fix remixing and bugs #313 and #315.