Fixed issue when required as a nodejs module