Fixed some JS Errors, e.g. toggle function