Fixed issue #183 (TMP_VAR is not only used once)