Fix and refine LiveScript implementation