Minor bug fixes, updated samples and added documentation.