fixes some issues on generate