Fixed a bug with initialisation