fix negated return value, fix missing cd