fixing type determination functions; fixing procedural functions generator