additional fork check and enhanced tests

Change-Id: I7d6ff30502aa5583aaf9154969394825f21cccb4