Lib + sample fixes