Fixed some bugs.
Finished example app.