Fixed error with STH-variable names in while loops