Fixed gate rendering. Fixes #810