Manually copied the fixes to jspdf.debug