Various test app fixes, not fully tested but no going back now.