Fixed some problems related to generic usage (to be continued)