Several improvements to finalbuilder scripts