More comprehensive example and some other smaller fixes.