STAN - bugfixes + npm support