Fix NullPointerException when labels aren't specified