Fixed errors in my javascript.