fix several bugs

1. complying
2. testing