Better js space handling