fixed some problems with primitives