This PR fix two issues? could you split them?