Repaired latex and fixed bug