Pass locals when calling render

Fixes issue #236