fixed int/float bug in unit factory