don't use deprecated functions in examples
expand SINGLETON_MODIFIER macros
remove use of macro
fix off by one error