Updates and fixes, added a sample project.