WYRL: working on eliminating bugs caused by changes to fix #274
WYRL: bug fixes for potentially null states.