Added Initialize/Terminate methods (+tests).