Fixed some problems with the primitives.