Fixed the initialization phase. Fails if no pattern has been given.