Fixed logic mistake in engine.h in comparing the number of primitives.  There should have been a <, but it was <=.