Fixes for working with latex