Fix some inconsistencies in the code and docs of primitives