Fix bugs found code reviewing last commit.