Fixed example code and a fatal bug in system