Corrected various Javascript errors on my end