Bug: fixed many bugs