Fix bugs in last commits