fixed #59, tests updated. Toolchain rebuild required