Bug fixed: wrong border conditions in sample