Fix overriding stage

Before, setting stage in the script was overridden by the stage provided
on the command line stage. This commit fixes it.