Solve two bugs