Minor improvements, including fixes, performance and safety

\b can also take a weight, see http://docs.aegisub.org/3.0/ASS_Tags/#index5h3