Stupid variable overwriting. Fixes #349