Added compressed option to regenerate and some general bug fixes