Move definition of labels
Make labels an option
Fix undefined event variable