Fixing js snippets