addressed https://github.com/kvz/phpjs/issues/138 and did some cleanup