Few bug fixes on the staging plugin