javascript fixes for demo