Fixes for latex generation