Fix: vars-on-top directive support (fixes #1235)

Fixes #1235.