Fix javascript errors with Turbolinks