Fixes undefined variables