Compiler: fix off-by-one errors in sourcemap generation