M3 - fixed some JS errors