Minor cleanup and further optimization of assembly language functions