Fixed tests failing starting from node v0.8.18 + slight changes