Fixed a problem with uninitialised variables.