adjust variable type (fixes #4024)