Commit fixes for compiling on ubuntu 12.04

John (et al):

More fixes for compiling on ubuntu 12.04.  Do check and review - note: casting plug->typeId() to unsigned int isn't pretty, however, without that I find that the compiler would issue a warning; and in-turn an error.