correctly fix calling convention problems from bug #42