Fix bugs and add sample project