Various fixes, added samples