Fixed bug with build tool and flash sectors, fixed closeStream bug