More tweaking of the JS! Some functions aren't triggered for some reason.