Sample and bug fixes