fix bug; re-enable test cases