Fixed possible crash on fence transition
Fixed #49, Working on #11
Fixed #48