Fixed bugs and added example project