Minor fixes for structured learning