Fix bugs in previous